#!/usr/local/bin/python3
# -*- coding: UTF-8 -*-
"""
@author:apple
@file:demo01.py
@time:2022/03/07
"""
import requests


def test01():
    ...
    url = "https://www.baidu.com"
    headers = {
        "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.109 Safari/537.36"
    }
    response = requests.get(url, headers=headers)

    print(response.text)


def test02():
    url = "https://fanyi.baidu.com/sug"
    data = {
        "kw":"我是"
    }
    headers = {
        "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.109 Safari/537.36"
    }

    response = requests.post(url, data=data, headers=headers)
    print(response.json())

def test03():
    ...
    opt = []

    if opt:
        print("1")
    else:
        print("2")

if __name__ == '__main__':
    pass
    # test02()
    test03()